Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport] 5.1.0 backports #2303

Merged
merged 31 commits into from
Apr 12, 2021
Merged

[Backport] 5.1.0 backports #2303

merged 31 commits into from
Apr 12, 2021

Conversation

furszy
Copy link

@furszy furszy commented Apr 8, 2021

Backport the following PRs to the 5.1 branch:

Missing open PRs that need to get merged to move forward with v5.1.0:

When every PR get merged, we can move forward with a new release candidate for the v5.1.0 release (rc3). Then one or two weeks of testing (depending on how many testers join the efforts) and we are ready for the production release.

The heart of v5.1.0 has been already battle tested this past month with the v5.1.0rc2 testing phase. The only remaining point that needs a more broadly usage/testing is #2290 that it's solving a reported issue in the recent release candidate.

PicklesRcool and others added 20 commits April 8, 2021 17:47
…o the 'Available' label in the top bar

Github-Pull: bitcoin#2247
Rebased-From: e21a560
Set custom transaction fee to highest possible value in case input
is too big number.

Github-Pull: bitcoin#2237
Rebased-From: ae1837e
/rest/mempool/info.json

And use it to fix a race condition in mempool_persist.py:
https://travis-ci.org/Empact/bitcoin/jobs/487577243

Since e.g. getrawmempool returns errors based on this status, this
enables users to test it for readiness.
Github-Pull: bitcoin#2254
Rebased-From: 0169a75
So the loaded state is explicitly mempool-specific.

Github-Pull: bitcoin#2254
Rebased-From: f0de789
Co-Authored-By: Wladimir J. van der Laan <laanwj@gmail.com>

Plus adapted it to PIVX.

Github-Pull: bitcoin#2262
Rebased-From: caa6734
Essentially, we were re-serializing every new connected block tip just to calculate the size and broadcast a notification for external listeners if the block size is above 1mb.

Which well..

(1) the block arrives serialized from the network and it's parsed into a block object by the core, there is no need to re-serialize the entire block..

(2) the complete serialization is just done to notify external listeners if a block exceeds the 1mb block size..  --> which can easily be done from outside of the core without having the most important node processing thread's work notifying nor calculating it, blocking cs_main for its whole time..

Github-Pull: bitcoin#2284
Rebased-From: 479d065
Ensures ordering of callbacks within a SingleThreadedSchedulerClient
with respect to each other

Github-Pull: bitcoin#2290
Rebased-From: 4ea2048
Ensures that callbacks are invoked in the order in which the chain is updated
Resolves bitcoin#12978

Github-Pull: bitcoin#2290
Rebased-From: ef24337
If the ShutdownRequested() check at the top of ActivateBestChain()
returns false during initial genesis block load we will fail an
assertion in UTXO DB flush as the best block hash IsNull(). To work
around this, we move the check until after one round of
ActivateBestChainStep(), ensuring the genesis block gets connected.

Github-Pull: bitcoin#2290
Rebased-From: 8640be1
Technically, some internal datastructures may be in an inconsistent
state if we do this, though there are no known bugs there. Still,
for future safety, its much better to only unlock cs_main if we've
made progress (not just tried a reorg which may make progress).

Github-Pull: bitcoin#2290
Rebased-From: 198f435
If multiple threads are invoking ActivateBestChain, it was possible to have
them working towards different tips, and we could arrive at a less work tip
than we should.  Fix this by introducing a ChainState lock which must
be held for the entire duration of ActivateBestChain to enforce
exclusion in ABC.

Github-Pull: bitcoin#2290
Rebased-From: a51a755
…s correct description of "prevblk-not-found"

Github-Pull: bitcoin#2290
Rebased-From: f68251d
After a recent bug discovered in callback ordering in MainSignals,
this test checks invariants in ordering of
BlockConnected / BlockDisconnected / UpdatedChainTip signals

Adaptation of btc@dd435ad40267f5c50ff17533c696f9302829a6a6

Github-Pull: bitcoin#2290
Rebased-From: 50dbec5
@furszy furszy self-assigned this Apr 8, 2021
@random-zebra random-zebra added this to the 5.1.0 milestone Apr 9, 2021
furszy and others added 7 commits April 9, 2021 18:09
It was only needed for the activation period, now that it's fully enforced, can be removed.
The activation time isn't needed, v5 enforcement checkpoint is ensuring that the chain cannot reorg to a time in which P2PKH stakes weren't enabled.

Github-Pull: bitcoin#2295
Rebased-From: 5aa3600
…ptBlock`

`CBlock` has a member `fChecked` that has the exact same purpose as the `fAlreadyCheckedBlock` flag.

Github-Pull: bitcoin#2295
Rebased-From: 362a598
furszy and others added 4 commits April 9, 2021 18:12
ProcessNewBlock is called by ProcessMessage (NetMsgType::BLOCK command) which is doing the exact same check: if the node does not have the previous block, request sync up to it.

Github-Pull: bitcoin#2295
Rebased-From: 959936f
@furszy
Copy link
Author

furszy commented Apr 9, 2021

Added #2215, #2283, #2295 and #2306 (this last one hasn't been merged yet).

@furszy
Copy link
Author

furszy commented Apr 10, 2021

#2306 was merged, this is ready to go.

Copy link

@random-zebra random-zebra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK 50a5e84

Copy link
Collaborator

@Fuzzbawls Fuzzbawls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 50a5e84

@Fuzzbawls Fuzzbawls merged commit a0f768a into PIVX-Project:5.1 Apr 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants